/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bground.collisions;


import bground.sprites.Bullet;
import bground.sprites.ExtendedSprite;
import external.golden.gamedev.object.Sprite;
import external.golden.gamedev.object.collision.BasicCollisionGroup;

/**
 *
 * @author s6_kustan_e
 */
public class PlayerBulletCollision extends BasicCollisionGroup {

    @Override
    public void collided(Sprite player, Sprite bullet) {
        if (((Bullet)bullet).getOwner() == player) {
            return;
        } else {
            ((ExtendedSprite)player).removeLive();
            ((ExtendedSprite)bullet).setActive(false);
        }
        System.out.println(player.toString() + " just died from " + bullet.toString());

    }

}
